<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./style.css">
</head>
<body>
    <div id="app">
        <textarea v-model="val"></textarea>
        <div v-html="mark"></div>
    </div>
</body>
</html>

<script src='https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js'></script>
<script src="https://cdn.bootcdn.net/ajax/libs/marked/1.2.7/marked.min.js"></script>
    
<script>
    let vm=new Vue({
        el:"#app",
        data:{
            val:"# 一级标题"
        },
        // 未加防抖
        computed: {
            mark(){
                console.log(this.val)
                console.log(marked(this.val))
                return marked(this.val)
            }
        }
    })
        
    
</script>
